/*
 * @Author: szx
 * @Date: 2023-01-27 05:11:44
 * @LastEditTime: 2023-04-17 16:06:18
 * @Description: 
 * @FilePath: \learn\fullstackopen\part6\redux-anecdotes-main\src\App.js
 */
/*
 * @Author: szx
 * @Date: 2023-01-27 05:11:44
 * @LastEditTime: 2023-04-17 13:45:36
 * @Description: 
 * @FilePath: \learn\fullstackopen\part6\redux-anecdotes-main\src\App.js
 */
import { useEffect } from 'react'
import { useDispatch } from 'react-redux'
import AnecdoteForm from './components/AnecdoteForm'
import AnecdoteList from './components/AnecdoteList'
import Notification from './components/Notification'
import Filter from './components/Filter'
import { initializeAnecdotes } from './reducers/anecdoteReducer'
const App = () => {
  const dispatch = useDispatch()
  useEffect(() => {
    dispatch(initializeAnecdotes())
  }, [dispatch])


  return (
    <div>
      <Notification />
      <Filter />
      <AnecdoteList />
      <AnecdoteForm />
    </div>
  )
}

export default App